package lesson09;

public class Master {
	public void cure(Pet pet) {
		pet.toHospital();
	}
	
	public void play(Pet pet) {
		if (pet instanceof Dog) {
			Dog dog=(Dog)pet;
			dog.catchFldisk();
		}else if (pet instanceof Penguin) {
			Penguin penguin=(Penguin)pet;
			penguin.swimming();
		}else if (pet instanceof Bird) {
			Bird bird=(Bird)pet;
			bird.Fly();
		}	
	}

}
